package com.fangxing.util;

public class RandomCodeGenerator {
    private static final String pool = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";

    public static String genCode(int length) {
        String result = "";
        for (int i = 0; i < length; i ++) {
            int index=(int)(Math.random()*pool.length());
            char ch = pool.charAt(index);
            result += ch;
        }

        return result;
    }
}
